import SwiftUI
import Charts

struct ChartWithData: View {
    var data: Array<Double> = [75, 25, 100, 50, 30, 60, 52, 88, 66]
    
    var body: some View {
        VStack {
            Text("Chart with data")
                .font(.largeTitle)
            
            // Bar table view
            Chart {
                // 
                ForEach(data, id: \.self) { d in
                    BarMark(
                        x: PlottableValue.value("Labels", "\(d)"),
                        y: PlottableValue.value("Values", d)
                    )
                    .foregroundStyle(Color.brown)
                }
            }
        }
        .padding(.horizontal)
    }
}
